import request from "@/utils/request";

export const getArticalsAPI = (obj) => {
  return request.get("/h5/interview/query", {
    params: {
      current: obj.current,
      pageSize: 10,
      sorter: obj.sorter,
    },
  });
};

export const getDetailByIdAPI = (id) => {
  return request({
    url: "/h5/interview/show",
    params: { id },
  });
};

// 点赞/收藏、取消点赞/取消收藏
export const updateDetailAPI = (id, optType) => {
  return request({
    url: "/h5/interview/opt",
    method: "post",
    data: {
      id,
      optType, //  1 喜欢  2 收藏
    },
  });
};

// 获取我的收藏
export const getCollectAndLikeAPI = (optType) => {
  return request({
    url: "/h5/interview/opt/list",
    params: {
      page: 1, // 当前页
      pageSize: 1000,
      optType: optType, // 2表示收藏, 1表示喜欢
    },
  });
};

